package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.qijian.maindata.domain.FrockLedger;
import com.qijian.maindata.domain.dto.LedgerStatisticsDTO;
import com.qijian.maindata.domain.query.FrockLedgerQuery;
import com.qijian.maindata.domain.vo.FrockLedgerVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 工装台账Mapper接口
 *
 * @author qijian
 * @date 2024-01-19
 */
public interface FrockLedgerMapper extends BaseMapper<FrockLedger> {

    @Select("select count(0) from main_frock_ledger WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    List<FrockLedgerVo> pageVo( @Param(Constants.WRAPPER) QueryWrapper<FrockLedgerQuery> queryWrapper);

    FrockLedgerVo getVo(@Param(value = "id") Long id);

    List<LedgerStatisticsDTO> getStatistics();

    List<LedgerStatisticsDTO> getStatisticsDetail(@Param(value = "deptId")String deptId);

    List<FrockLedger> ListForExcel(@Param(Constants.WRAPPER) QueryWrapper<FrockLedgerQuery> queryWrapper);
}
